package com.zatech.cgnci.project.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.DecimalMin;
import java.math.BigDecimal;
import java.util.List;

/**
 * @author EDY
 * @version 1.0
 * Create by 2024/12/18 17:40
 */
@Data
@ApiModel(value = "CheckHyRiskSubTypesDTO")
public class CheckHyRiskSubTypesDTO {

    @ApiModelProperty("险种编码")
    private String riskSubTypeCodes;

    @ApiModelProperty(value = "合约分出信息")
    private List<CheckReinsuranceInfoDTO> checkReinsuranceInfo;

    @Data
    public static class CheckReinsuranceInfoDTO {

        @ApiModelProperty("具体业务类型(1-成数,2-溢额,3-成数溢额混合,4-累计损失超赔,5-险位超赔,6-巨灾超赔),码表值:contractType")
        private String businessType;

        @ApiModelProperty("险类")
        private List<CheckReinsuranceRiskDTO> checkRisks;

    }

    @Data
    public static class CheckReinsuranceRiskDTO {

        @ApiModelProperty("分入分出险种ID")
        private Long reinsuranceRiskId;

        @ApiModelProperty("险类")
        private String riskClass;

        @ApiModelProperty("险类代码")
        private String riskClassCode;

        @ApiModelProperty("险种")
        private String riskSubType;

        @ApiModelProperty("险种代码")
        private String riskSubTypeCode;

        @ApiModelProperty("保险标的名称")
        private String insuredObject;

        @ApiModelProperty("保险标的类型(1-在案;2-离案),码表值:onshoreOffshore")
        private String insuredType;

        @ApiModelProperty("离岸业务归属地")
        private String offshoreTerritory;

        @ApiModelProperty("险种层列表")
        private List<CheckReinsuranceRiskLayerDTO> checkRiskLayers;
    }

    @Data
    public static class CheckReinsuranceRiskLayerDTO {

        @ApiModelProperty("层ID")
        private Long layerId;

        @ApiModelProperty("层名称")
        private String layerName;

        @ApiModelProperty("层序号")
        private Integer layerSequence;

        @ApiModelProperty("保单限额")
        @DecimalMin(value = "0", message = "保单限额必须大于0")
        private BigDecimal policyLimit;

        @ApiModelProperty("承接比例")
        @DecimalMin(value = "0", message = "承接比例必须大于0")
        private BigDecimal shareRatio;

        @ApiModelProperty("承接限额")
        @DecimalMin(value = "0", message = "承接限额必须大于0")
        private BigDecimal shareLimit;

        @ApiModelProperty("起赔点")
        @DecimalMin(value = "0", message = "起赔点必须大于0")
        private BigDecimal deductible;

        @ApiModelProperty("赔偿限额")
        @DecimalMin(value = "0", message = "赔偿限额必须大于0")
        private BigDecimal compensationLimit;

        @ApiModelProperty("层占比")
        @DecimalMin(value = "0", message = "层占比必须大于0")
        private BigDecimal layerPremiumRatio;

        @ApiModelProperty("自留额")
        //@DecimalMin(value = "0", message = "自留额必须大于0")
        private BigDecimal retentionAmount;

        @ApiModelProperty("分入/分出毛保费")
        @DecimalMin(value = "0", message = "毛保费必须大于0")
        private BigDecimal grossPremium;

        @ApiModelProperty("分入/分出手续费")
        @DecimalMin(value = "0", message = "手续费必须大于0")
        private BigDecimal commission;

        @ApiModelProperty("分入/分出净保费")
        @DecimalMin(value = "0", message = "净保费必须大于0")
        private BigDecimal netPremium;

        @ApiModelProperty("分入/分出再保经纪费")
        @DecimalMin(value = "0", message = "再保经纪费必须大于0")
        private BigDecimal brokerFee;

        @ApiModelProperty("免赔说明")
        private String deductibleDesc;

        @ApiModelProperty("分入限额")
        @DecimalMin(value = "0", message = "分入限额必须大于0")
        private BigDecimal engagedLimit;

        @ApiModelProperty("分出比例")
        @DecimalMin(value = "0", message = "分出比例必须大于0")
        private BigDecimal cededRatio;

        @ApiModelProperty("分出限额")
        @DecimalMin(value = "0", message = "分出限额必须大于0")
        private BigDecimal cededLimit;

        @ApiModelProperty("预估保费")
        @DecimalMin(value = "0", message = "预估保费必须大于0")
        private BigDecimal estimatedPremium;

        @ApiModelProperty("单次事故最高赔偿限额")
        @DecimalMin(value = "0", message = "单次事故最高赔偿限额必须大于0")
        private BigDecimal singleAccidentLimit;

        @ApiModelProperty("费率")
        @DecimalMin(value = "0", message = "费率必须大于0")
        private BigDecimal rate;

        @ApiModelProperty("预估GNPI")
        @DecimalMin(value = "0", message = "预估GNPI必须大于0")
        private BigDecimal estimateGnpi;

        @ApiModelProperty("再保人定价")
        @DecimalMin(value = "0", message = "再保人定价必须大于0")
        private BigDecimal reinsurerPricing;

        @ApiModelProperty("线数")
        private Integer layerLines;

    }


}
